#ifndef __THREAD_H__
#define __THREAD_H__

#include "NonCopyable.h"
#include <pthread.h>
#include <functional>

namespace myNameSpace {
using TaskCallback = std::function<void()>; 

class Thread: NonCopyable {
public:
    Thread(TaskCallback &&taskCallback);
    ~Thread() = default;

    void start();
    void join();

private:
    static void * start_routine(void *arg);

private:
    pthread_t _threadId;
    bool _isRunning;
    TaskCallback _taskCallback;
};
} // end of namespace myNameSpace

#endif
